package Logic.SceneSample;

import FrameWork.World.AbstractScene;

public class SimpleScene extends AbstractScene {

    private static final Runnable FLAG = new Runnable() {
        @Override
        public void run() {

        }
    };

    @Override
    protected void tick(long time) {
        System.out.println(Thread.currentThread().getName());
        //以FLAG作为分界点
        submit(FLAG);
        while(!messageQueue.isEmpty()){
            Runnable task = messageQueue.poll();
            if (task==FLAG){
                break;
            }
            if (task != null){
                task.run();
            }
        }
    }
}
